<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', 'Home\IndexController@index');
Route::get('/cate/{cate_id}', 'Home\IndexController@cate');
Route::get('/art', 'Home\IndexController@article');
Route::get('/a/{article_id}', 'Home\IndexController@article');

Route::any('admin/login', 'Admin\LoginController@login');
Route::get('admin/code', 'Admin\LoginController@code');
Route::any('admin/crypt', 'Admin\LoginController@crypt');

Route::any('admin/server', 'Admin\LoginController@server');

Route::group(['middleware' => ['admin.login'], 'prefix' => 'admin', 'namespace' => 'Admin'], function () {
	Route::get('/', 'IndexController@index');
	Route::get('info', 'IndexController@info');
	Route::get('quit', 'LoginController@quit');
	Route::any('pass', 'IndexController@pass');
	Route::post('cate/changeOrder', 'CategoryController@changeOrder');
	Route::resource('category', 'CategoryController');
	Route::resource('article', 'ArticleController');

	Route::post('links/changeOrder', 'LinksController@changeOrder');
	Route::post('navs/changeOrder', 'NavsController@changeOrder');
	Route::post('config/changeOrder', 'ConfigController@changeOrder');
	Route::post('config/changeContent', 'ConfigController@changeContent');
	Route::get('config/putFile', 'ConfigController@putFile');


	Route::resource('navs', 'NavsController');

	Route::resource('links', 'LinksController');
	Route::resource('config', 'ConfigController');

	Route::any('upload', 'CommonController@upload');



});